<template>
	<view class="register_page">
		<view>
			<image src="/static/logo.png"></image>
		</view>
		<!-- 公共组件-每个页面必须引入 -->
		<view class="title">
			<text :class="{active:type == 2000}" @click="type = 2000">密码登录</text>
			<text :class="{active:type == 1000}" @click="type = 1000">验证码登录</text>
		</view>
		<view class="input_box">
			<input type="text" v-model="phone" placeholder="请输入您的电话号码" />
		</view>
		<view class="input_box" v-if="type == 1000">
			<input type="number" v-model="code" placeholder="请输入您的验证码" maxlength="6" @confirm="onSubmit" />
			<button class="active" @click="onSetCode">{{ codeText }}</button>
		</view>
		<view class="input_box" v-if="type == 2000">
			<input type="text" v-model="password" password placeholder="请输入密码" @confirm="onSubmit" />
		</view>
		<view class="btn_box">
			<button @click="onSubmit">登录</button>
		</view>
		<view class="agreement">
			进入即代表你已同意
			<text @click="onPageJump('/pages/auth/protocol')">《用户协议》</text>
		</view>
		<view class="nav_box" v-if="type == 1000">
			<text class="color" @click="onPageJump('/pages/auth/register')">去注册</text>
		</view>
		<view class="nav_box" v-if="type == 2000">
			<text class="color" @click="onPageJump('/pages/auth/register')">去注册</text>
			<text @click="onPageJump('/pages/auth/forget')">忘记密码？</text>
		</view>
		<!-- #ifdef APP-PLUS -->
		<view class="station" v-if="!isIos"></view>
		<view class="third_party_login_box" v-if="!isIos">
			<view class="third_party_title"><text>第三方登录</text></view>
			<view class="third_party_content"><image src="../../static/icon/wechat.png" @click="onWxAppLogin" mode="aspectFit"></image></view>
		</view>
		<!-- #endif -->
		<view class="remindPwd"><checkbox value="cb" checked="true" />记住密码</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type: 2000,
				code: '',
				phone: '199*****989',
				password: '******',
				//验证码
				codeText: '获取验证码',
				//验证码已发
				readonly: false,
				isIos:true
			}
		},
		methods: {
			// 提交
			onSubmit() {
				uni.switchTab({
					url: '../index/index'
				})
			},
			onPageJump(url) {
				uni.navigateTo({
					url
				})
			}
		},
	}
</script>

<style lang="scss" scoped>
@import '@/style/mixin.scss';
	.register_page {
		padding: calc(var(--status-bar-height) + 70upx) 50upx 50upx 50upx;
		background-color: #fff;
		min-height: 100vh;
		image{
			width: 280upx;
			height: 280upx;
			display: block;
			margin: 10upx auto 60upx;
		}
		.title {
			margin-bottom: 50upx;
			display: flex;
			align-items: center;
			text {
				font-size: 36upx;
				color: #999;
				&.active {
					// font-size: 48upx;
					color: #333333;
					font-weight: bold;
				}
				&:nth-child(2){
					margin-left: 70upx;
				}
			}
		}
		.input_box {
			display: flex;
			align-items: center;
			border-bottom: 2upx solid #e5e5e5;
			padding: 30upx 0;
			margin-top: 20upx;
			input {
				flex: 1;
				font-size: 32upx;
				color: #333;
				height: 60upx;
			}
			button {
				height: 60upx;
				background-color: #f7f7f7;
				font-size: 24upx;
				border-radius: 8upx;
				padding: 0 14upx;
				color: #333;
				line-height: 60upx;
				margin-left: 20upx;
				&.active {
					// @include theme('btn_bg');
					// background-color: $themeColor;
					background-color: #FFA07A;
					color: #fff;
				}
			}
		}
		.btn_box {
			margin: 60upx 0 30upx 0;
			button {
				// @include theme('btn_bg');
				background-color: #FFA07A;
				color: #fff;
				height: 92upx;
				line-height: 92upx;
				border-radius: 8upx;
			}
		}
		.agreement {
			font-size: 24upx;
			color: #999999;
			> text {
				color: #FFA07A;
			}
		}
		.password_register {
			margin-top: 110upx;
			text-align: center;
			text {
				font-size: 24upx;
				color: #333333;
				text-decoration: underline;
			}
		}
		.nav_box {
			margin-top: 30upx;
			display: flex;
			justify-content: space-between;
			> text {
				font-size: 24upx;
				color: #333333;
				&.color {
					color: #FFA07A;
				}
			}
		}
	}
	.station {
		height: 230upx;
	}
	.third_party_login_box {
		position: absolute;
		bottom: 0;
		width: 100%;
		left: 0;
		height: 230upx;
		padding: 0 30upx;
		.third_party_title {
			display: flex;
			align-items: center;
			&:before,
			&:after {
				content: '';
				flex: 1;
				height: 2upx;
				background-color: #f5f5f5;
			}
			text {
				font-size: 24upx;
				color: #999999;
				flex-shrink: 0;
				padding: 0 20upx;
			}
		}
		.third_party_content {
			height: 200upx;
			display: flex;
			justify-content: center;
			align-items: center;
			image {
				width: 60upx;
				height: 52upx;
			}
		}
	}
	.remindPwd{
		font-size: 14px;
		margin-top: 10px;
		line-height: 1.5;
	}
</style>
